<!--
 * @Description: 子组件1
 * @Author: Zhanghan
 * @Date: 2025-01-18 18:02:36
 * @LastEditTime: 2025-01-25 14:35:59
 * @LastEditors: Zhanghan
-->
<template>
    <div>
        <div>子组件one</div>
        <div>count: {{ count }}</div>
        <ChildTwo />
    </div>
</template>

<script lang="ts" setup>
import { ref , inject } from "vue";
import ChildTwo from "./ChildTwo.vue";

// 注入响应式的值--子组件不能直接修改
const count = inject('count');
</script>